/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.book.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * book_infoEntity
 * @author lonjey
 * @version 2018-11-10
 */
@Table(name="book_info", alias="a", columns={
		@Column(name="bookid", attrName="bookid", label="书籍id", isPK=true),
		@Column(name="name", attrName="name", label="书名", queryType=QueryType.LIKE),
		@Column(name="author", attrName="author", label="作者"),
		@Column(name="cover", attrName="cover", label="封面"),
		@Column(name="brief", attrName="brief", label="简介"),
		@Column(name="sort", attrName="sort", label="分类"),
		@Column(name="wordcount", attrName="wordcount", label="字数"),
		@Column(name="updatatime", attrName="updatatime", label="更新时间"),
		@Column(name="latestchapter", attrName="latestchapter", label="最新章节"),
		@Column(name="bookstatus", attrName="bookstatus", label="更新状态"),
	}, orderBy="a.bookid DESC"
)
public class BookInfo extends DataEntity<BookInfo> {
	
	private static final long serialVersionUID = 1L;
	private String bookid;		// 书籍id
	private String name;		// 书名
	private String author;		// 作者
	private String cover;		// 封面
	private String brief;		// 简介
	private String sort;		// 分类
	private Long wordcount;		// 字数
	private Date updatatime;		// 更新时间
	private String latestchapter;		// 最新章节
	private Long bookstatus;		// 更新状态
	
	public BookInfo() {
		this(null);
	}

	public BookInfo(String id){
		super(id);
	}
	
	public String getBookid() {
		return bookid;
	}

	public void setBookid(String bookid) {
		this.bookid = bookid;
	}
	
	@Length(min=0, max=255, message="书名长度不能超过 255 个字符")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=255, message="作者长度不能超过 255 个字符")
	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}
	
	@Length(min=0, max=255, message="封面长度不能超过 255 个字符")
	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}
	
	@Length(min=0, max=500, message="简介长度不能超过 500 个字符")
	public String getBrief() {
		return brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}
	
	@Length(min=0, max=255, message="分类长度不能超过 255 个字符")
	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}
	
	public Long getWordcount() {
		return wordcount;
	}

	public void setWordcount(Long wordcount) {
		this.wordcount = wordcount;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUpdatatime() {
		return updatatime;
	}

	public void setUpdatatime(Date updatatime) {
		this.updatatime = updatatime;
	}
	
	@Length(min=0, max=255, message="最新章节长度不能超过 255 个字符")
	public String getLatestchapter() {
		return latestchapter;
	}

	public void setLatestchapter(String latestchapter) {
		this.latestchapter = latestchapter;
	}
	
	public Long getBookstatus() {
		return bookstatus;
	}

	public void setBookstatus(Long bookstatus) {
		this.bookstatus = bookstatus;
	}
	
}